import request from '@/utils/httpRequest'

// 碧划算广告和icon获取列表接口（type分别为BANNER和icon）
export function searchAdList (value) {
  return request({
    url: '/bihs/ad/search',
    method: 'post',
    data: value || {}
  })
}
// 碧划算广告和icon位置接口（type分别为BANNER和icon）
export function getPosition (value) {
  return request({
    url: '/bihs/ad/position',
    method: 'post',
    data: value || {}
  })
}

// 广告位管理保存设置
export function saveAdSetting (data = {}) {
  return request({
    url: '/bihs/ad/save',
    method: 'post',
    data
  })
}
//广告详情信息获取
export function getAdDetail (params = {}) {
  return request({
    url: '/bihs/ad/get',
    method: 'get',
    params
  })
}
// 获取内页类型
export function getAdTypes (params = {}) {
  return request({
    url: '/bihs/ad/types',
    method: 'get',
    params
  })
}

// 中部广告位列表
export function middleAdList (data = {}) {
  return request({
    url: '/bihs/ad/template/list',
    method: 'post',
    data
  })
}

// 中部广告位编辑获取广告数据
export function middleAdDetail (params = {}) {
  return request({
    url: '/bihs/ad/template/get',
    method: 'get',
    params
  })
}

// 中部广告位编辑获取广告数据
export function middleAdEditData (params = {}) {
  return request({
    url: '/bihs/ad/template/ad-setting/list',
    method: 'get',
    params
  })
}

// 中部广告位新建编辑保存
export function middleAdSave (data = {}) {
  return request({
    url: '/bihs/ad/template/save',
    method: 'post',
    data
  })
}
